import threading
from time import sleep
##@brief this plugin is thread sample.

class SubThread(threading.Thread):
	def __init__(self):
		super(SubThread, self).__init__()
		self._stop = threading.Event()
	
	def quit(self):
		self._stop.set()
	
	def run(self):
		while not self._stop.isSet():
			sleep(1)
			print "I'm SubThread"

def start():
	global thread
	thread = SubThread()
	thread.setDaemon(True)
	thread.start()

def stop():
	global thread
	thread.stop()

def quit():
	global thread
	thread.quit()

def join():
	global thread
	thread.join()
